﻿using DalatCooking.Core.Helper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DalatCooking.Core;

public partial class UserControls_Category : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        
    }
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);
        Category c = CategoryManager.FindById(CategoryID);
        Page.Title = (c != null) ? c.Name : "Not found";
        lblCategoryName.Text = (c != null) ? c.Name : "Not found";
        pictureCate.Src = "" + ((c != null) ? c.Picture : "/uploads/images/noimage.png");
        lblDesc.Text = (c != null) ? c.Description : "Not found";
        lblCateName.Text = (c != null) ? c.Name : "Not found";
      
    }
    public int CategoryID
    {
        get {
            if (Request.QueryString["CategoryID"] != null)
                return ConvertObject.ToInt(Server.HtmlEncode(Request.QueryString["CategoryID"]));
            return -1;
        }
    }
    
    
}